<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
        <link rel="stylesheet" href="${request.contextPath}/statics/plugins/layui2.5/css/layui.css"  media="all">
</head>
<body>
<div id="rrapp" v-cloak>
    <div class="panel panel-default">
        <div class="col-lg-3">
            <div class="panel panel-default">
                <div class="panel-heading">设备列表</div>
                <div class="panel-body" style="min-height: 730px;">
                    <ul id="equipmentTree" class="ztree"></ul>
                </div>
            </div>
        </div>
        <div class="col-lg-9">
            <div class="panel panel-default">
                <div class="panel-heading">阈值设置</div>
                <div class="panel-body">
                    <form class="layui-form">
                    <table class="form" id="form" width="100%">
                        <tr>
                            <td class="formTitle" style="width: 150px">设备名称</td>
                            <td class="formValue">
                                <input  type="text" class="form-control" v-model="lhpThresholdSetting.equimentName"  readonly="readonly">
                            </td>
                            <td></td>
                            <td width="50px;"></td>
                            <td class="formTitle" style="width: 150px">等级编码</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.levelId" readonly="readonly"/>
                            </td>
                        </tr>
                        <!-- 能见度 -->
                        <tr>
                            <td class="formTitle" style="width: 150px">能见度:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.visibility" placeholder=""/>
                            </td>
                            <td  class="formValue">
                                <div class="layui-form-item">
                                    <input id="visibilityStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <!--路面温度  -->
                            <td class="formTitle" style="width: 150px">路面温度:</td>
                            <td class="formValue">
                                <input type="text"  class="form-control" v-model="lhpThresholdSetting.roadSurfaceTemp" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <div class="layui-form-item">
                                        <input  id="roadSurfaceTempStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                    </div>
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <!--摩擦系数-->
                            <td class="formTitle" style="width: 150px">摩擦系数:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.friction" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <div class="layui-form-item">
                                        <input id="frictionStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                    </div>
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <!--水膜高度-->
                            <td class="formTitle" style="width: 150px">水膜高度:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.waterFilmHeight" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <div class="layui-form-item">
                                        <input id="waterFilmHeightStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                    </div>
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <!--路面状态-->
                            <td class="formTitle" style="width: 150px">路面状态:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.roadCondition" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="roadConditionStatus" class="cb" type="checkbox" name="close"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <!--风速-->
                            <td class="formTitle" style="width: 150px">风速:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.windSpeed" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="windSpeedStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <!--含冰比例-->
                            <td class="formTitle" style="width: 150px">含冰比例:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.icePercentage" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="icePercentageStatus" class="cb" type="checkbox" name="close"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <!--相对湿度-->
                            <td class="formTitle" style="width: 150px">相对湿度:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.relativeHumidity" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="relativeHumidityStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <!--降雨强度-->
                            <td class="formTitle" style="width: 150px">降水强度:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.precipitationIntensity" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="precipitationIntensityStatus" class="cb" type="checkbox" name="close"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <!--空气温度-->
                            <td class="formTitle" style="width: 150px">空气温度:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.airTemp" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="airTempStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <td class="formTitle" style="width: 150px">降水量:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.precipitation" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="precipitationStatus" class="cb" type="checkbox" name="close"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <td class="formTitle" style="width: 150px">水积累量:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.waterAmount" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="waterAmountStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>
                        <tr>
                            <td class="formTitle" style="width: 150px">雪积累量:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.snowAmount" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="snowAmountStatus" class="cb" type="checkbox" name="close"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                            <td class="formTitle" style="width: 150px">冰积累量:</td>
                            <td class="formValue">
                                <input type="text" class="form-control" v-model="lhpThresholdSetting.iceAmount" placeholder=""/>
                            </td>
                            <td class="formValue">
                                <div class="layui-form-item">
                                    <input id="iceAmountStatus" class="cb" type="checkbox"  name="close" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                </div>
                            </td>
                            <td width="10px;"></td>
                        </tr>

                        <tr>
                            <td colspan="6" style="text-align: center;">
                                <input  type="button" id="btnSaveOrUpdate" class="btn btn-primary"  data-loading-text="保存中..." @click="saveOrUpdate" value="确定修改">
                            </td>
                        </tr>
                    </table>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="${request.contextPath}/statics/plugins/layui2.5/layui.all.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/baseinfo/lhpthresholdsetting.js?_${.now?long}"></script>

<script>
    layui.use('form', function(){
        var form = layui.form;
        //监听指定开关
        form.on('switch(switchTest)', function(data){
            /*layer.msg(this+'开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });*/
            if(this.id=="visibilityStatus"){
                vm.lhpThresholdSetting.visibilityStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="roadSurfaceTempStatus"){
                vm.lhpThresholdSetting.roadSurfaceTempStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="frictionStatus"){
                vm.lhpThresholdSetting.frictionStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="waterFilmHeightStatus"){
                vm.lhpThresholdSetting.waterFilmHeightStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="roadConditionStatus"){
                vm.lhpThresholdSetting.roadConditionStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="windSpeedStatus"){
                vm.lhpThresholdSetting.windSpeedStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="icePercentageStatus"){
                vm.lhpThresholdSetting.icePercentageStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="relativeHumidityStatus"){
                vm.lhpThresholdSetting.relativeHumidityStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="precipitationIntensityStatus"){
                vm.lhpThresholdSetting.precipitationIntensityStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="airTempStatus"){
                vm.lhpThresholdSetting.airTempStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="precipitationStatus"){
                vm.lhpThresholdSetting.precipitationStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="waterAmountStatus"){
                vm.lhpThresholdSetting.waterAmountStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="snowAmountStatus"){
                vm.lhpThresholdSetting.snowAmountStatus=(this.checked == true ?"0":"1");
            }else if(this.id=="iceAmountStatus"){
                vm.lhpThresholdSetting.iceAmountStatus=(this.checked == true ?"0":"1");
            }
            layer.tips( data.othis)
        });
    })

</script>
</body>
</html>